import { commonService } from '~/config/server'
import { NetService } from '~/utils/net.service'
import { Inject, Debounce } from "~/core/decorator";
import { Service } from "~/core/service"

export class DataPoolService extends Service {

  @Inject(NetService)
  private netService: NetService
  
  /**
   * 获取特殊数据字典数据
   */
  public getDataPools() {
    return this.netService.send({
      server: commonService.dataPoolController.getDataPools
    })
  }
  /**
   * 获取点击当前数据字典数据
   */
  public getDataPool(data) {
    return this.netService.send({
      server: commonService.dataPoolController.getDataPool,
      data
    })
  }
  /**
   * 增加/修改特殊数据字典数据
   */
  @Debounce()
  public addDataPoolDict(data) {
    return this.netService.send({
      server: commonService.dataPoolController.addDataPoolDict,
      data
    })
  }
  /**
   * 获取父级特殊数据字典数据
   */
  @Debounce()
  public getDataPoolParent() {
    return this.netService.send({
      server: commonService.dataPoolController.getDataPoolParent
    })
  }
  /**
   * 删除特殊数据字典数据
   */
  @Debounce()
  public deleteDataDict(data) {
    return this.netService.send({
      server: commonService.dataPoolController.deleteDataDict,
      data
    })
  }
}

